package com.szqhyxj.youxiangju.sys.components.view.popview;

import android.content.Context;
import android.support.v4.content.ContextCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.szqhyxj.youxiangju.R;

/**
 * XiaoPanYu
 * on 2018/10/27
 */
public class HintPopView extends BaseDialog{
    private TextView tvKnow;
    private TextView tvTitle;
    private ImageView img;
    private String title;
    private int imgId ;
    public HintPopView(Context context){
        super(context);
    }

    public HintPopView(Context context,String title,int imgId){
        super(context);
        this.title = title;
        this.imgId = imgId;

        img.setImageDrawable(ContextCompat.getDrawable(context,imgId));
        tvTitle.setText(title);
    }

    @Override
    protected View initDialogView(Context context){
        View view = LayoutInflater.from(context).inflate(R.layout.popview_single, null);
        tvKnow = view.findViewById(R.id.tv_know);
        tvTitle = view .findViewById(R.id. tv_title);
        img = view.findViewById(R.id.iv_img);
        tvKnow.setOnClickListener(this);
        return view;
    }


    @Override
    public void onClick(View v){
        super.onClick(v);
        switch(v.getId()){
            case R.id.tv_know:
                dismiss();
        }
    }

    public void setTitle(String st){
        tvTitle.setText(st);
    }

    public void setImg(Context mContext,int imgId){

    }
}



